<!--
#
# lookup.html
#   This software is part of a movie DB suite
# Copyright (C) 2010 Kyran Owen-Mankovich

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
-->
<html>
  <head> 
    <title>Kyran's Movie DB</title> 
    <link href="MochiKit/sortable_tables.css" rel="stylesheet" type="text/css" /> 
    <script type="text/javascript" src="MochiKit/MochiKit.js"></script> 
    <script type="text/javascript" src="MochiKit/sortable_tables.js"></script> 
  </head> 
  <body>
    <form action="/" method="get">
      <div><strong>Movie Title:</strong><input type="text" name="title" size="60"/>
      <input type="submit" value="Lookup Movie" /></div>
    </form>

    {% if results %}
    <h3>Movie Choices:</h3>

    <ul>
    {% for result in results %}
      <li>
      <form action="add" method="get">
      <input type="hidden" name="tt" value="{{result.imdbid|escape}}" />
      <input type="submit" value="Add Movie" />
      <a href="http://www.imdb.com/title/tt{{result.imdbid|escape}}/">{{result.title|escape}}</a>
      </form>
      </li>
      {% endfor %}
    </ul>
    {% else %}
      {% if movies %}
        {% include "movielist.html" %}
      {% endif %}
    {% endif %}

  </body>
</html>
